#ifndef _STRLIB_H_
#define _STRLIB_H_

#define NULL ((void *)0)
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;

char *mystrcpy(char *dest, char *src);
int mystrcmp(char *s1, char *s2);
u32 mystrlen(char *str);
char *mystrcat(char *dest, char *src);
char *mystrstr(char *src, char *sub, u32 maxLength);
void *mymemcpy2(void *dest, void *src, u32 n);
u32 str2num(char *str); // str to u32 number, radix = 10
char *num2str(u32 num, char *str, u8 radix); // u32 num to str

#define mstrcpy(dest, src) mystrcpy(dest, src)
#define mstrcmp(s1, s2) mystrcmp(s1, s2)
#define mstrlen(str) mystrlen(str)
#define mstrcat(dest, src) mystrcat(dest, src)
#define mstrstr(src, sub, maxLength) mystrstr(src, sub, maxLength)
#define mmemcpy(dest, src, n) mymemcpy2(dest, src, n) 

#endif